home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1985 Winter / rerun-1985-winter.d64 / perfect pitch (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  3KB  |  112 lines

  1. 4 rem pitch switch
  2. 5 rem ear training 1, c64 version
  3. 6 rem major scale
  4. 7 n=10
  5. 8 dimsl$(5)
  6. 9 sl$(1)="017037019063021154022227025177028214032094034075"
  7. 10 sl$(2)="010060011114012216013156015070017037019063020100"
  8. 11 sl$(3)="022227025177028214030141034075038126043052045198"
  9. 12 sl$(4)="027056030141034075036085040200045198051097054111"
  10. 13 sl$(5)="007163008147009159010060011114012216014107015070"
  11. 15 v=54296:a2=54284:s2=54285:h2=54280:l2=54279:w2=54283
  12. 16 sc=53281:bo=53280:co=54272:cr=53272
  13. 17 pokecr,23:pokea2,12:pokes2,240
  14. 19 pokesc,1:pokebo,6
  15. 20 print"[147]             [208]itch [211]witch               [146]"
  16. 21 print" [212]his program will help you to recognize";
  17. 22 print"pitch differences between notes of a":print"major scale."
  18. 23 print" [217]ou must answer";n;"right to finish the":print"game."
  19. 24 print" [201]f you need to hear a problem repeated,";
  20. 25 print"press the 'f1' key."
  21. 38 print"            [208]ress any key."
  22. 40 getm$:ifm$=""then40
  23. 42 pokebo,7:r=0:w=0:print"[147][196]ifficulty [204]evel[146]"
  24. 43 print"1.-[203]eynote intervals on the same scale."
  25. 44 print"2.-[203]eynote intervals on varying scales."
  26. 45 print"3.-[214]arying intervals on varying scales."
  27. 47 print" [194]egin by selectintg  1,2,or 3."
  28. 50 getl$:ifl$=""then50
  29. 53 l=val(l$)
  30. 54 ifl>3orl<1then50
  31. 79 rem play scale
  32. 90 sn=int(rnd(1)*5+1)
  33. 100 pokebo,2:print"[147][200]ere is a major scale."
  34. 103 pokev,15:print""
  35. 105 for k=1to8
  36. 110 ph=val(mid$(sl$(sn),6*k-5,3))
  37. 111 pl=val(mid$(sl$(sn),6*k-2,3))
  38. 120 pokeh2,ph:pokel2,pl:pokew2,17:printtab(2*k+2)"[145][145][145][172][165]"
  39. 121 printtab(2*k+2)k
  40. 130 fori=1to200:nexti
  41. 140 pokew2,0
  42. 150 nextk:pokev,0
  43. 160 rem give problem
  44. 165 ifan$="[133]"then180
  45. 170 nn=int(rnd(1)*8+1)
  46. 171 n1=int(rnd(1)*8+1)
  47. 172 ifl<3thenn1=1
  48. 180 fh=val(mid$(sl$(sn),6*n1-5,3))
  49. 181 fl=val(mid$(sl$(sn),6*n1-2,3))
  50. 190 sh=val(mid$(sl$(sn),6*nn-5,3))
  51. 191 sl=val(mid$(sl$(sn),6*nn-2,3))
  52. 195 fori=1to500:nexti
  53. 196 ifl<3then200
  54. 197 print"[200]ere are two notes of the scale.":wm=0:goto205
  55. 199 ifl<3then200
  56. 200 print"[200]ere is the keynote followed by one of":print"the others.":wm=0
  57. 205 fori=1to500:nexti
  58. 209 pokev,15
  59. 210 pokeh2,fh:pokel2,fl:pokew2,17
  60. 213 print"":forx=1ton1:printtab(2*x+2)"[145]";:nextx
  61. 214 print"[172][165][146]":printtab(2*x)"";n1;"[146]"
  62. 220 fori=1to300:nexti
  63. 230 pokew2,0
  64. 240 fori=1to300:nexti
  65. 250 pokeh2,sh:pokel2,sl:pokew2,17
  66. 260 fori=1to300:nexti
  67. 270 pokew2,0:pokev,0
  68. 275 ifwm=1then610
  69. 280 print"[212]ype the number of the second note.    "
  70. 281 print"                      "
  71. 290 getan$:ifan$=""then290
  72. 291 ifan$="[133]"then100
  73. 293 an=val(an$)
  74. 294 ifan=0then290
  75. 295 ifan=nnthen500
  76. 300 goto600
  77. 499 rem correct
  78. 500 pokebo,0:print"[195][207][210][210][197][195][212][146]":pokev,15:pokeh2,115:pokel2,88:pokew2,17
  79. 501 fori=1to80:nexti
  80. 502 pokew2,0:pokev,0
  81. 508 fori=1to1000:nexti
  82. 510 r=r+1
  83. 515 ifr=nthen800
  84. 520 ifl=1then100
  85. 530 goto90
  86. 599 rem wrong
  87. 600 pokebo,13:pokev,15:pokew2,33:forx=1to8
  88. 601 pokeh2,100-12*x:pokel2,100+12*x:fori=1to200:nexti:nextx
  89. 602 pokew2,0:pokev,0:wm=1
  90. 605 print"[212]he answer is...":goto205
  91. 610 print"":forx=1tonn:printtab(2*x+2)"[145]";:nextx
  92. 611 print"[172][165][146]":printtab(2*x)"";nn;"[146]"
  93. 613 print"         [208]ress any key."
  94. 615 getm$:ifm$=""then610
  95. 620 w=w+1
  96. 630 ifl=1then100
  97. 640 goto90
  98. 799 rem tally score
  99. 800 pokebo,1:pokev,15:pokew2,17
  100. 801 print"[147]   [217][193][200][207][207]![146]":forx=1to30:pokeh2,100+5*x:pokel2,50
  101. 802 fori=1to20:nexti
  102. 803 nextx
  103. 805 pokew2,0:pokev,0
  104. 806 print" [217]ou got";r;"right out of";r+w;"."
  105. 810 print"[208]ress '[193]' for another round."
  106. 820 print"[208]ress '[210]' to return to the beginning."
  107. 830 print"[208]ress '[197]' to end."
  108. 840 getm$:ifm$=""then840
  109. 850 ifm$="a"then42
  110. 853 ifm$="r"then19
  111. 856 print"[147]":pokecr,21:end
  112.